<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Create new company</title>
<script language="javascript" type="text/javascript"
	src="js/datepicker.js"></script>
<link rel="stylesheet" href="css/datepicker.css" />
<link rel="stylesheet" href="css/common.css" />
<script language="javascript" type="text/javascript" src="js/common.js"></script>
<script language="javascript" type="text/javascript"
	src="js/jquery-1.6.1.min.js"></script>

<script language="javascript" type="text/javascript">
	var requiredInputs = [ [ '', '' ], [ '', '' ], [ '', '' ], [ '', '' ],
			[ '', '' ], [ '', '' ], [ '', '' ] ];
	var intInputs = [ [ '', '' ], [ '', '' ], [ '', '' ], [ '', '' ],
			[ '', '' ], [ '', '' ], [ '', '' ] ];
	var doubleInputs = [ [ '', '' ], [ '', '' ], [ '', '' ], [ '', '' ],
			[ '', '' ], [ '', '' ], [ '', '' ] ];
	var dateInputs = [ [ '', '' ], [ '', '' ], [ '', '' ], [ '', '' ],
			[ '', '' ], [ '', '' ], [ '', '' ] ];
	var timeInputs = [ [ '', '' ], [ '', '' ], [ '', '' ], [ '', '' ],
			[ '', '' ], [ '', '' ], [ '', '' ] ];

	function checkInputs() {
		var valid = true;

		if (!checkRequiredInputs(requiredInputs) == false) {
			valid = false;
		}
		if (!checkIntInputs(intInputs) == false) {
			valid = false;
		}
		if (!checkDoubleInputs(doubleInputs) == false) {
			valid = false;
		}
		if (!checkDateInputs(dateInputs) == false) {
			valid = false;
		}
		if (!checkTimeInputs(timeInputs) == false) {
			valid = false;
		}

		// SPECIFIC VALIDATE CODE HERE

		return valid;
	}
</script>
</head>
<body>
	<jsp:include page="menu.jsp"></jsp:include>

	<form action="company?mode=insert" method="post"
		onreset="return confirm('Do you really want to reset the form?')">
		<table class="tblInput" border="1">
			<tr class="inputHeader">
				<td colspan="3" class="inputHeader">Create new company</td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Is competitor</td>
				<td class="tdFieldInput">
					<table class="tblBool">
						<tr class="trBoolSet">
							<td colspan="2" class="tdBoolSet"><input type="checkbox"
								id="ckb_is_competitor"
								onchange="toggleControls(['is_competitor_true', 'is_competitor_false'])" />Not
								set</td>
						</tr>
						<tr class="trBool">
							<td class="tdBool"><input type="radio"
								id="is_competitor_true" name="is_competitor" value="1"
								checked="checked" />Yes</td>
							<td class="tdBool"><input type="radio"
								id="is_competitor_false" name="is_competitor" value="0" />No</td>
						</tr>
					</table></td>
				<td class="tdErrMsg"></td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Abb name</td>
				<td class="tdFieldInput"><input class="inputText" type="text"
					id="abb_name" maxlength="10" />
				</td>
				<td class="tdErrMsg"><span id="abb_name_required"
					class="errMsg" style="display: block;">Abb name is required</span>
					<span id="abb_name_invalid" class="errMsg" style="display: block;">Abb
						name is invalid</span>
				</td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Description</td>
				<td class="tdFieldInput"><textarea id="description" rows="5"
						class="inputTextarea"></textarea>
				</td>
				<td class="tdErrMsg"><span id="description_required"
					class="errMsg" style="display: block;">Description is
						required</span> <span id="description_invalid" class="errMsg"
					style="display: block;"> Description is invalid</span>
				</td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Status</td>
				<td class="tdFieldInput"><input class="inputInt" type="text"
					id="status" maxlength="10" />
				</td>
				<td class="tdErrMsg"><span id="status_required" class="errMsg"
					style="display: block;">Status is required</span> <span
					id="status_invalid" class="errMsg" style="display: block;">Status
						is invalid</span></td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Price</td>
				<td class="tdFieldInput"><input class="inputNumeric"
					type="text" id="price" maxlength="20" />
				</td>
				<td class="tdErrMsg"><span id="price_required" class="errMsg"
					style="display: block;">Price is required</span> <span
					id="price_invalid" class="errMsg" style="display: block;">Price
						is invalid</span></td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Established date</td>
				<td class="tdFieldInput">
					<table class="tblDateTime">
						<tr class="trDateTime">
							<td class="tdDate"><input type="text" maxlength="10"
								class="inputDate" id="established_date" name="established_date" />
								<input type="button" class="btnCalendar" value="..."
								onclick="javascript:displayDatePicker('established_date', this, dateFormat);" />
							</td>
							<td class="tdTime"><input type="text" maxlength="5"
								class="inputTime" id="established_time" />
							</td>
						</tr>
					</table></td>
				<td class="tdErrMsg">
					<div class="divErr">
						<span id="established_date_required" class="errMsg"
							style="display: block;">Date is required</span>
					</div>
					<div class="divErr">
						<span id="established_time_required" class="errMsg"
							style="display: block;">Time is required</span>
					</div>
					<div class="divErr">
						<span id="established_date_invalid" class="errMsg"
							style="display: block;">Date is invalid</span>
					</div>
					<div class="divErr">
						<span id="established_time_invalid" class="errMsg"
							style="display: block;">Data is invalid</span>
					</div>
				</td>
			</tr>
			<tr class="trInputBottom">
				<td class="trInputBottom" colspan="3">
					<table class="tblSubmit" align="center">
						<tr class="trSubmit">
							<td class="tdSubmit"><input type="submit" value="Submit" />
							</td>
							<td class="tdReset"><input type="reset" value="Reset" /></td>
						</tr>
					</table></td>
			</tr>
		</table>
	</form>
</body>
</html>